package com.workpaper.app.workpaper.daily.view.listener;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;

import com.workpaper.app.workpaper.daily.business.DailyWorkpaperBusiness;
import com.workpaper.app.workpaper.daily.entity.DailyWorkpaper;
import com.workpaper.app.workpaper.daily.view.DailyWorkpaperEditDialog;
/**
 * 工作日报编辑按钮监听
 * @author zhouyujun
 *
 */
public class EditDailyWorkpaperListener extends SelectionAdapter{

	@Override
	public void widgetSelected(SelectionEvent e) {
		Button btn = (Button) e.widget;
		String id = (String) btn.getData();
		DailyWorkpaperBusiness business = DailyWorkpaperBusiness.getInstance();
		DailyWorkpaper dailyWorkpaper = business.selectById(id);
		DailyWorkpaperEditDialog editDialog = new DailyWorkpaperEditDialog(null, dailyWorkpaper);
		editDialog.open();
	}
}
